package com.awei.study.design.structure.proxy;

/**
 * @Author liweilong
 * @Date 2024/8/2 16:37
 * 静态代理
 */
public class StaticsProxy {
    public interface SellWindows{
        void sell();
    }

    public static class TrainSell implements SellWindows {

        @Override
        public void sell() {
            System.out.println("火车站售票");
        }
    }

    public static class ProxyPoint implements SellWindows {

        private TrainSell trainSell = new TrainSell();

        @Override
        public void sell() {
            System.out.println("收取中介费");
            trainSell.sell();
        }
    }

    public static void main(String[] args) {
        ProxyPoint proxyPoint = new ProxyPoint();
        proxyPoint.sell();
    }
}
